<!DOCTYPE html><html lang="zh-CN" data-theme="dark"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>iOS 自动化打包之fastlane | Albert Yuan's Blog</title><meta name="keywords" content="iOS,iOS 进阶"><meta name="author" content="Albert Yuan"><meta name="copyright" content="Albert Yuan"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#0d0d0d"><meta name="referrer" content="no-referrer"><meta name="description" content="fastlane的安装1 、第一步因为fastlane是用Ruby语言编写的工具，所以必须保证已经配置好了Ruby开发环境。可以使用如下命令行查看是否安装了Ruby： 1234ruby -v#如果有以下提示说明，你已经安装了Ruby：ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin21]   如果没有安装需要先安装ruby，本">
<meta property="og:type" content="article">
<meta property="og:title" content="iOS 自动化打包之fastlane">
<meta property="og:url" content="https://yllove.gitee.io/2022/11/04/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS%20%E8%87%AA%E5%8A%A8%E5%8C%96%E6%89%93%E5%8C%85%E4%B9%8Bfastlane/index.html">
<meta property="og:site_name" content="Albert Yuan&#39;s Blog">
<meta property="og:description" content="fastlane的安装1 、第一步因为fastlane是用Ruby语言编写的工具，所以必须保证已经配置好了Ruby开发环境。可以使用如下命令行查看是否安装了Ruby： 1234ruby -v#如果有以下提示说明，你已经安装了Ruby：ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin21]   如果没有安装需要先安装ruby，本">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fupload-images.jianshu.io%2Fupload_images%2F1345654-f27701c6da64262b.png%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F1240&refer=http%3A%2F%2Fupload-images.jianshu.io&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670155153&t=9df0930adc7e55112de00dc7c84f6f6b">
<meta property="article:published_time" content="2022-11-04T11:57:51.360Z">
<meta property="article:modified_time" content="2022-11-04T12:37:43.100Z">
<meta property="article:author" content="Albert Yuan">
<meta property="article:tag" content="iOS">
<meta property="article:tag" content="iOS 进阶">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fupload-images.jianshu.io%2Fupload_images%2F1345654-f27701c6da64262b.png%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F1240&refer=http%3A%2F%2Fupload-images.jianshu.io&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670155153&t=9df0930adc7e55112de00dc7c84f6f6b"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="https://yllove.gitee.io/2022/11/04/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS%20%E8%87%AA%E5%8A%A8%E5%8C%96%E6%89%93%E5%8C%85%E4%B9%8Bfastlane/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css" media="print" onload="this.media='all'"><script src="https://fastly.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js" defer></script><script>const GLOBAL_CONFIG = { 
  root: '/blog/',
  algolia: {"appId":"X8NS0XSX99","apiKey":"b9d4530647c8b5bf7928a04c47752ad7","indexName":"albertyuan","hits":{"per_page":6},"languages":{"input_placeholder":"搜索文章","hits_empty":"找不到您查询的内容：${query}","hits_stats":"找到 ${hits} 条结果，用时 ${time} 毫秒"}},
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://fastly.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://fastly.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://fastly.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://fastly.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: true,
  isanchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'iOS 自动化打包之fastlane',
  isPost: true,
  isHome: false,
  isHighlightShrink: true,
  isToc: true,
  postUpdate: '2022-11-04 20:37:43'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/blog/atom.xml" title="Albert Yuan's Blog" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="/blog/img/favicon.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">155</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">56</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">32</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fupload-images.jianshu.io%2Fupload_images%2F1345654-f27701c6da64262b.png%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F1240&amp;refer=http%3A%2F%2Fupload-images.jianshu.io&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1670155153&amp;t=9df0930adc7e55112de00dc7c84f6f6b')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/blog/">Albert Yuan's Blog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">iOS 自动化打包之fastlane</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-11-04T11:57:51.360Z" title="发表于 2022-11-04 19:57:51">2022-11-04</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-11-04T12:37:43.100Z" title="更新于 2022-11-04 20:37:43">2022-11-04</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/blog/categories/iOS-UI/">iOS UI</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1.7k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>7分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="iOS 自动化打包之fastlane"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h4 id="fastlane的安装"><a href="#fastlane的安装" class="headerlink" title="fastlane的安装"></a>fastlane的安装</h4><h6 id="1-、第一步"><a href="#1-、第一步" class="headerlink" title="1 、第一步"></a>1 、第一步</h6><p>因为fastlane是用Ruby语言编写的工具，所以必须保证已经配置好了Ruby开发环境。可以使用如下命令行查看是否安装了Ruby：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">ruby -v</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">如果有以下提示说明，你已经安装了Ruby：</span></span><br><span class="line">ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin21]</span><br></pre></td></tr></table></figure>


<p>如果没有安装需要先安装ruby，本文对安装ruby不作教程说明。</p>
<hr>
<h5 id="2、第二步"><a href="#2、第二步" class="headerlink" title="2、第二步"></a>2、第二步</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">安装Xcode命令行工具</span></span><br><span class="line">xcode-select --install</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">如果没有安装，命令会有提示框，根据提示一步一步安装即可。 如果出现以下命令提示，说明已经安装成功：</span></span><br><span class="line">xcode-select: error: command line tools are already installed, use &quot;Software Update&quot; to install updates</span><br></pre></td></tr></table></figure>

<hr>
<h5 id="3、第三步："><a href="#3、第三步：" class="headerlink" title="3、第三步："></a>3、第三步：</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">Ruby和Xcode环境都配置好之后，执行以下命令来安装fastlane：</span></span><br><span class="line">sudo gem install -n /usr/local/bin fastlane</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">安装完成之后，输入以下命令查看是否安装成功</span></span><br><span class="line">fastlane --version</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">出现以下提示说明你已经安装成功了：</span></span><br><span class="line">fastlane installation at path:</span><br><span class="line">/Users/xxxxxx/.rvm/gems/ruby-2.7.0/gems/fastlane-2.206.1/bin/fastlane</span><br><span class="line">-----------------------------</span><br><span class="line">[✔] 🚀 </span><br><span class="line">fastlane 2.206.1</span><br></pre></td></tr></table></figure>

<hr>
<h4 id="fastlane的配置"><a href="#fastlane的配置" class="headerlink" title="fastlane的配置"></a>fastlane的配置</h4><h5 id="1、到你的iOS项目下，执行初始化命令："><a href="#1、到你的iOS项目下，执行初始化命令：" class="headerlink" title="1、到你的iOS项目下，执行初始化命令："></a>1、到你的iOS项目下，执行初始化命令：</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"> fastlane init</span><br><span class="line"><span class="meta prompt_"> </span></span><br><span class="line"><span class="meta prompt_"> #</span><span class="language-bash">命令执行完成之后会给出我们如下几个提示：</span></span><br><span class="line"> </span><br><span class="line"> [✔] 🚀 </span><br><span class="line">[✔] Looking for iOS and Android projects in current directory...</span><br><span class="line">[16:54:04]: Created new folder &#x27;./fastlane&#x27;.</span><br><span class="line">[16:54:04]: Detected an iOS/macOS project in the current directory: &#x27;xxxx.xcworkspace&#x27;</span><br><span class="line"></span><br><span class="line">[16:54:04]: -----------------------------</span><br><span class="line"></span><br><span class="line">[16:54:04]: --- Welcome to fastlane 🚀 ---</span><br><span class="line"></span><br><span class="line">[16:54:04]: -----------------------------</span><br><span class="line"></span><br><span class="line">[16:54:04]: fastlane can help you with all kinds of automation for your mobile app</span><br><span class="line">[16:54:04]: We recommend automating one task first, and then gradually automating more over time</span><br><span class="line">[16:54:04]: What would you like to use fastlane for?</span><br><span class="line"></span><br><span class="line">1. 📸  Automate screenshots</span><br><span class="line">2. 👩‍✈️  Automate beta distribution to TestFlight</span><br><span class="line">3. 🚀  Automate App Store distribution</span><br><span class="line">4. 🛠  Manual setup - manually setup your project to automate your tasks</span><br></pre></td></tr></table></figure>

<blockquote>
<p> 命令执行到最后有What would you like to use fastlane for?提示，此时fastlane列出几个选项，需要我们告诉它使用fastlane需要执行哪种操作:</p>
</blockquote>
<ul>
<li><p>第一种获取App Store的App预览照片。</p>
</li>
<li><p>第二种打包上传至TestFlight工具上。</p>
</li>
<li><p>第三种打包上传到App Store。</p>
</li>
<li><p>第四种自定义打包方式。</p>
<p>以上四种方式根据自己的需要自行选择，本文主要介绍打包上传至第三方平台，所以选择4自定义打包方式。选择完成之后，fastlane会在我们项目中创建fastlane文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">- </span><br><span class="line"></span><br><span class="line">[16:54:32]: ------------------------------------------------------------</span><br><span class="line"></span><br><span class="line">[16:54:32]: --- Setting up fastlane so you can manually configure it ---</span><br><span class="line"></span><br><span class="line">[16:54:32]: ------------------------------------------------------------</span><br><span class="line"></span><br><span class="line">[16:54:32]: Installing dependencies for you...</span><br><span class="line"></span><br><span class="line">[16:54:32]: $ bundle update</span><br><span class="line"></span><br><span class="line">[16:54:40]: --------------------------------------------------------</span><br><span class="line"></span><br><span class="line">[16:54:40]: --- ✅  Successfully generated fastlane configuration ---</span><br><span class="line"></span><br><span class="line">[16:54:40]: --------------------------------------------------------</span><br><span class="line"></span><br><span class="line">[16:54:40]: Generated Fastfile at path `./fastlane/Fastfile`</span><br><span class="line"></span><br><span class="line">[16:54:40]: Generated Appfile at path `./fastlane/Appfile`</span><br><span class="line"></span><br><span class="line">[16:54:40]: Gemfile and Gemfile.lock at path `Gemfile`</span><br><span class="line"></span><br><span class="line">[16:54:40]: Please check the newly generated configuration files into git along with your project</span><br><span class="line"></span><br><span class="line">[16:54:40]: This way everyone in your team can benefit from your fastlane setup</span><br><span class="line"></span><br><span class="line">[16:54:40]: Continue by pressing Enter ⏎</span><br></pre></td></tr></table></figure>


<p>创建好fastlane文件夹之后，Appfile是编辑我们相关App和开发者账号信息的，默认已经根据变量配置好了,一般不需要我们去手动修改。Fastfile是我们对自动打包这个过程的完整配置，默认的Fastfile文件内容如下:</p>
</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">This file contains the fastlane.tools configuration</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">You can find the documentation at https://docs.fastlane.tools</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment"># For a list of all available actions, check out</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment">#     https://docs.fastlane.tools/actions</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment"># For a list of all available plugins, check out</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment">#     https://docs.fastlane.tools/plugins/available-plugins</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment"># Uncomment the line if you want fastlane to automatically update itself</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">update_fastlane</span></span><br><span class="line"></span><br><span class="line">default_platform(:ios) #固定不用修改</span><br><span class="line"></span><br><span class="line">platform :ios do #固定不用修改</span><br><span class="line">  desc &quot;Description of what the lane does&quot;</span><br><span class="line">  </span><br><span class="line">  lane :custom_lane do  #lane操作名称；一个lane相当于一个合集，一个合集下可以有很多action操作，命令行终究是通过lane来执行操作的</span><br><span class="line">    # add actions here: https://docs.fastlane.tools/actions</span><br><span class="line">  end</span><br><span class="line">  </span><br><span class="line">end</span><br></pre></td></tr></table></figure>



<h5 id="2、打包并自动上传-App-到蒲公英"><a href="#2、打包并自动上传-App-到蒲公英" class="headerlink" title="2、打包并自动上传 App 到蒲公英"></a>2、打包并自动上传 App 到蒲公英</h5><h6 id="安装蒲公英的-fastlane-插件"><a href="#安装蒲公英的-fastlane-插件" class="headerlink" title="安装蒲公英的 fastlane 插件"></a>安装蒲公英的 fastlane 插件</h6><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fastlane add_plugin pgyer</span><br></pre></td></tr></table></figure>

<h6 id="编辑Fastlane-的配置文件-fastlane-x2F-Fastfile"><a href="#编辑Fastlane-的配置文件-fastlane-x2F-Fastfile" class="headerlink" title="编辑Fastlane 的配置文件 fastlane&#x2F;Fastfile"></a>编辑Fastlane 的配置文件 fastlane&#x2F;Fastfile</h6><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">lane :develop do</span><br><span class="line">   target = &quot;demo&quot;</span><br><span class="line">   configuration = &quot;Debug&quot;</span><br><span class="line">   gym(scheme: target, configuration: configuration, export_method:&quot;development&quot;)</span><br><span class="line">   pgyer(api_key: &quot;7f15xxxxxxxxxxxxxxxxxx141&quot;, user_key: &quot;4a5bcxxxxxxxxxxxxxxx3a9e&quot;)</span><br><span class="line"><span class="meta prompt_">   #</span><span class="language-bash">注意这里这样使用会报错，因为蒲公英插件0.2.4版本已经没有user_key字段了，得删了才能用</span></span><br><span class="line">end</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">新版正确做法</span></span><br><span class="line">lane :develop do</span><br><span class="line">   target = &quot;demo&quot;</span><br><span class="line">   configuration = &quot;Debug&quot;</span><br><span class="line">   gym(scheme: target, configuration: configuration, export_method:&quot;development&quot;)</span><br><span class="line">   pgyer(api_key: &quot;7f15xxxxxxxxxxxxxxxxxx141&quot;)</span><br><span class="line">end</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<blockquote>
<p>以下是蒲公英平台的说明：</p>
<p>以上的api_key 和user_key，请开发者在自己账号下的应用管理 -App概述 -API 中可以找到，并替换到以上相应的位置。<br>在 Xcode 8.3 和 Xcode 8.3 以后的版本中，对于build_app 的export_method 的值，需要根据开发者的打包类型进行设置，可选的值有：app-store、ad-hoc、development、enterprise。对于 Xcode 8.3 以下的版本，则不需要设置export_method。<br>经过以上配置后，就可以使用 Fastlane 来打包 App，并自动上传到蒲公英了。在终端下，定位到项目所在目录，输入以下命令即可：</p>
</blockquote>
<h6 id="自动打包分发实现"><a href="#自动打包分发实现" class="headerlink" title="自动打包分发实现"></a>自动打包分发实现</h6><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">fastlane develop</span><br><span class="line"></span><br><span class="line">在成功的情况下，可以看到类似下面的信息：</span><br><span class="line"></span><br><span class="line">[18:37:22]: Successfully exported and compressed dSYM file</span><br><span class="line">[18:37:22]: Successfully exported and signed the ipa file:</span><br><span class="line"></span><br><span class="line">[18:37:22]: /Users/xxx/Documents/workCode/xxxxx.ipa</span><br><span class="line">[18:37:22]: -------------------</span><br><span class="line"></span><br><span class="line">[18:37:22]: --- Step: pgyer ---</span><br><span class="line"></span><br><span class="line">[18:37:22]: -------------------</span><br><span class="line"></span><br><span class="line">[18:37:22]: The pgyer plugin is working.</span><br><span class="line">[18:37:22]: build_file: /Users/dddd/Documents/workCode/xxxx.ipa</span><br><span class="line">[18:37:22]: Start upload /Users/dddd/Documents/workCode/xxx.ipa to pgyer...</span><br><span class="line">[18:37:43]: Upload success. Visit this URL to see: https://www.pgyer.com/xxxxx</span><br><span class="line"></span><br><span class="line">+------+------------------+-------------+</span><br><span class="line">|           fastlane summary            |</span><br><span class="line">+------+------------------+-------------+</span><br><span class="line">| Step | Action           | Time (in s) |</span><br><span class="line">+------+------------------+-------------+</span><br><span class="line">| 1    | default_platform | 0           |</span><br><span class="line">| 2    | gym              | 61          |</span><br><span class="line">| 3    | pgyer            | 20          |</span><br><span class="line">+------+------------------+-------------+</span><br><span class="line"></span><br><span class="line">[18:37:43]: fastlane.tools finished successfully 🎉</span><br><span class="line"></span><br><span class="line">设置一个版本更新时的描述信息：</span><br><span class="line">lane :develop do</span><br><span class="line">  build_app(export_method: &quot;development&quot;)</span><br><span class="line">  pgyer(api_key: &quot;7f15xxxxxxxxxxxxxxxxxx141&quot;, user_key: &quot;4a5bcxxxxxxxxxxxxxxx3a9e&quot;, update_description: &quot;update by fastlane&quot;)</span><br><span class="line">end</span><br></pre></td></tr></table></figure>


<h6 id="打包上传到Testflight"><a href="#打包上传到Testflight" class="headerlink" title="打包上传到Testflight"></a>打包上传到Testflight</h6><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">在Fastfile文件中加入下面命令：</span></span><br><span class="line"></span><br><span class="line">desc &quot;打包上传到Testflight&quot;</span><br><span class="line">  lane :beta do</span><br><span class="line">    # add actions here: https://docs.fastlane.tools/actions</span><br><span class="line">   target = &quot;demo&quot;</span><br><span class="line">   configuration = &quot;Release&quot;</span><br><span class="line">   gym(scheme: target, configuration: configuration, export_method:&quot;app-store&quot;)</span><br><span class="line">   upload_to_testflight(</span><br><span class="line">      username: &quot;xxxx@dd.com&quot;,</span><br><span class="line">            app_identifier: &quot;com.xxxx&quot;,</span><br><span class="line">          )</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">在命令行输入：</span></span><br><span class="line">fastlane beta</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">打包上传的过程中会让你输入苹果账号的密码，并且有可能会报下面的错：</span></span><br><span class="line"></span><br><span class="line">[00:20:28]: Login successful</span><br><span class="line">[00:20:31]: Ready to upload new build to TestFlight (App: fffff)...</span><br><span class="line">[00:20:40]: Transporter transfer failed.</span><br><span class="line">[00:20:40]: </span><br><span class="line">[00:20:40]: Please sign in with an app-specific password. You can create one at appleid.apple.com. (-22910)</span><br><span class="line">[00:20:41]: </span><br><span class="line">[00:20:41]: Your account has 2 step verification enabled</span><br><span class="line">[00:20:41]: Please go to https://appleid.apple.com/account/manage</span><br><span class="line">[00:20:41]: and generate an application specific password for</span><br><span class="line">[00:20:41]: the iTunes Transporter, which is used to upload builds</span><br><span class="line">[00:20:41]: </span><br><span class="line">[00:20:41]: To set the application specific password on a CI machine using</span><br><span class="line">[00:20:41]: an environment variable, you can set the</span><br><span class="line">[00:20:41]: FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD variable</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">这是因为你的APP4LE账号开启了双重验证，注意这句提示Please sign <span class="keyword">in</span> with an app-specific password用app专用密码登录，提示你创建一个app专用密码登录Transporter，关于怎么创建app专用密码本人不做讲解，可以自行百度或者谷歌，使用app专用账号即可解决此问题。</span></span><br></pre></td></tr></table></figure>




<hr>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Albert Yuan</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://yllove.gitee.io/2022/11/04/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS%20%E8%87%AA%E5%8A%A8%E5%8C%96%E6%89%93%E5%8C%85%E4%B9%8Bfastlane/">https://yllove.gitee.io/2022/11/04/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS%20%E8%87%AA%E5%8A%A8%E5%8C%96%E6%89%93%E5%8C%85%E4%B9%8Bfastlane/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://yllove.gitee.io" target="_blank">Albert Yuan's Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/blog/tags/iOS/">iOS</a><a class="post-meta__tags" href="/blog/tags/iOS-%E8%BF%9B%E9%98%B6/">iOS 进阶</a></div><div class="post_share"><div class="social-share" data-image="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fupload-images.jianshu.io%2Fupload_images%2F1345654-f27701c6da64262b.png%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F1240&amp;refer=http%3A%2F%2Fupload-images.jianshu.io&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1670155153&amp;t=9df0930adc7e55112de00dc7c84f6f6b" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://fastly.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blog/2022/10/28/iOS/iOS-ViewController%E4%B8%8EView%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F/"><img class="prev-cover" src= "" data-lazy-src="/blog/img/defaultCover.png" onerror="onerror=null;src='/blog/img/defaultCover.gif'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">iOS UIViewController和UIView的生命周期</div></div></a></div><div class="next-post pull-right"><a href="/blog/2022/11/04/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/ios%20webclip%E6%8A%80%E6%9C%AF/"><img class="next-cover" src= "" data-lazy-src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.book-dl.com%2Fuploads%2F20200207%2F82783ea470cefbef61fe2b27bab72756.jpg&amp;refer=http%3A%2F%2Fwww.book-dl.com&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1670160152&amp;t=ff6e76cf4f0b1f2aea4f3f55bb170b2d" onerror="onerror=null;src='/blog/img/defaultCover.gif'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">iOS webclip技术</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/blog/2022/02/16/iOS开发进阶/iOS-Architecture-Patterns/" title="iOS-Architecture-Patterns"><img class="cover" src= "" data-lazy-src="/blog/img/defaultCover.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-02-16</div><div class="title">iOS-Architecture-Patterns</div></div></a></div><div><a href="/blog/2021/09/17/iOS开发进阶/ios多环境配置/" title="ios多环境配置"><img class="cover" src= "" data-lazy-src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.mscto.com%2Fwp-content%2Fuploads%2F2020%2F02%2F20200224171828585.png&refer=http%3A%2F%2Fwww.mscto.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1634454044&t=4fb9df90cc72cb1ac69ea2f9af7ae428" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-09-17</div><div class="title">ios多环境配置</div></div></a></div><div><a href="/blog/2021/10/15/iOS逆向/iOS逆向Reveal查看任意app的界面/" title="iOS逆向Reveal查看任意app的界面"><img class="cover" src= "" data-lazy-src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fq_70%2Cc_zoom%2Cw_640%2Fimages%2F20180725%2Fb973d56e7782472ca6751412991ca51c.jpeg&refer=http%3A%2F%2F5b0988e595225.cdn.sohucs.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1636872714&t=636290a6a8db7f6820c8eb5b79902ee1" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-10-15</div><div class="title">iOS逆向Reveal查看任意app的界面</div></div></a></div><div><a href="/blog/2021/12/02/iOS逆向/ios签名机制/" title="ios签名机制"><img class="cover" src= "" data-lazy-src="/blog/img/defaultCover.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-12-02</div><div class="title">ios签名机制</div></div></a></div><div><a href="/blog/2021/09/22/iOS逆向/ios集成Reveal的三种方式/" title="ios快速集成Reveal查看自己的APP"><img class="cover" src= "" data-lazy-src="https://img1.baidu.com/it/u=656872413,3497509168&fm=15&fmt=auto" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-09-22</div><div class="title">ios快速集成Reveal查看自己的APP</div></div></a></div><div><a href="/blog/2022/04/19/iOS逆向/获取IPA中的图片资源/" title="获取IPA中的图片资源"><img class="cover" src= "" data-lazy-src="/blog/img/defaultCover.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-19</div><div class="title">获取IPA中的图片资源</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="/blog/img/favicon.png" onerror="this.onerror=null;this.src='/blog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Albert Yuan</div><div class="author-info__description">博学之,审问之,慎思之,明辨之,笃行之</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">155</div></a></div><div class="card-info-data-item is-center"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">56</div></a></div><div class="card-info-data-item is-center"><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">32</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/yuanliangYL"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/yuanliangYL" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:yuanliangios@163.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="qq:1023817403" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">love cat , love life</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-4"><a class="toc-link" href="#fastlane%E7%9A%84%E5%AE%89%E8%A3%85"><span class="toc-text">fastlane的安装</span></a><ol class="toc-child"><li class="toc-item toc-level-6"><a class="toc-link" href="#1-%E3%80%81%E7%AC%AC%E4%B8%80%E6%AD%A5"><span class="toc-text">1 、第一步</span></a></li></ol></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2%E3%80%81%E7%AC%AC%E4%BA%8C%E6%AD%A5"><span class="toc-text">2、第二步</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#3%E3%80%81%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A"><span class="toc-text">3、第三步：</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#fastlane%E7%9A%84%E9%85%8D%E7%BD%AE"><span class="toc-text">fastlane的配置</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#1%E3%80%81%E5%88%B0%E4%BD%A0%E7%9A%84iOS%E9%A1%B9%E7%9B%AE%E4%B8%8B%EF%BC%8C%E6%89%A7%E8%A1%8C%E5%88%9D%E5%A7%8B%E5%8C%96%E5%91%BD%E4%BB%A4%EF%BC%9A"><span class="toc-text">1、到你的iOS项目下，执行初始化命令：</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2%E3%80%81%E6%89%93%E5%8C%85%E5%B9%B6%E8%87%AA%E5%8A%A8%E4%B8%8A%E4%BC%A0-App-%E5%88%B0%E8%92%B2%E5%85%AC%E8%8B%B1"><span class="toc-text">2、打包并自动上传 App 到蒲公英</span></a><ol class="toc-child"><li class="toc-item toc-level-6"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E8%92%B2%E5%85%AC%E8%8B%B1%E7%9A%84-fastlane-%E6%8F%92%E4%BB%B6"><span class="toc-text">安装蒲公英的 fastlane 插件</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E7%BC%96%E8%BE%91Fastlane-%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6-fastlane-x2F-Fastfile"><span class="toc-text">编辑Fastlane 的配置文件 fastlane&#x2F;Fastfile</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E8%87%AA%E5%8A%A8%E6%89%93%E5%8C%85%E5%88%86%E5%8F%91%E5%AE%9E%E7%8E%B0"><span class="toc-text">自动打包分发实现</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E6%89%93%E5%8C%85%E4%B8%8A%E4%BC%A0%E5%88%B0Testflight"><span class="toc-text">打包上传到Testflight</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/2023/02/07/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS-%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BD%91%E9%A1%B5%E4%B8%8B%E8%BD%BDIPA%E5%8C%85/" title="iOS 自定义网页下载IPA包"><img src= "" data-lazy-src="https://img.mp.itc.cn/upload/20170409/1a8f793d7282451cbd1beb6841608c90_th.jpeg" onerror="this.onerror=null;this.src='/blog/img/defaultCover.gif'" alt="iOS 自定义网页下载IPA包"/></a><div class="content"><a class="title" href="/blog/2023/02/07/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS-%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BD%91%E9%A1%B5%E4%B8%8B%E8%BD%BDIPA%E5%8C%85/" title="iOS 自定义网页下载IPA包">iOS 自定义网页下载IPA包</a><time datetime="2023-02-07T02:46:29.851Z" title="更新于 2023-02-07 10:46:29">2023-02-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2023/02/06/Flutter/Flutter%E6%8E%A5%E5%85%A5%E5%8E%9F%E7%94%9F-iOS/" title="flutter接入原生-iOS"><img src= "" data-lazy-src="https://pic4.zhimg.com/v2-6a115fea4db1ad770dccf4119bfab36f_1440w.jpg?source=172ae18b" onerror="this.onerror=null;this.src='/blog/img/defaultCover.gif'" alt="flutter接入原生-iOS"/></a><div class="content"><a class="title" href="/blog/2023/02/06/Flutter/Flutter%E6%8E%A5%E5%85%A5%E5%8E%9F%E7%94%9F-iOS/" title="flutter接入原生-iOS">flutter接入原生-iOS</a><time datetime="2023-02-07T01:18:53.661Z" title="更新于 2023-02-07 09:18:53">2023-02-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/12/17/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS%20%E5%A6%82%E4%BD%95%E5%9C%A8%E6%A8%A1%E6%8B%9F%E5%99%A8%E4%B8%AD%E5%AE%89%E8%A3%85APP/" title="iOS 如何在模拟器中安装APP"><img src= "" data-lazy-src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.winwin7.com%2Fuploadfile%2F2021%2F0114%2F20210114141748239.jpg&amp;refer=http%3A%2F%2Fwww.winwin7.com&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1673854539&amp;t=aad2108ffb799b04e94a28cc58f038f1" onerror="this.onerror=null;this.src='/blog/img/defaultCover.gif'" alt="iOS 如何在模拟器中安装APP"/></a><div class="content"><a class="title" href="/blog/2022/12/17/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/iOS%20%E5%A6%82%E4%BD%95%E5%9C%A8%E6%A8%A1%E6%8B%9F%E5%99%A8%E4%B8%AD%E5%AE%89%E8%A3%85APP/" title="iOS 如何在模拟器中安装APP">iOS 如何在模拟器中安装APP</a><time datetime="2022-12-17T07:48:56.594Z" title="更新于 2022-12-17 15:48:56">2022-12-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/08/05/Swift/swift%E5%B8%B8%E7%94%A8%E4%B8%89%E6%96%B9%E5%BA%93/" title="swift常用三方库"><img src= "" data-lazy-src="https://photos.infinum.com/store/b558bd40787ecad225d9c66322f14522" onerror="this.onerror=null;this.src='/blog/img/defaultCover.gif'" alt="swift常用三方库"/></a><div class="content"><a class="title" href="/blog/2021/08/05/Swift/swift%E5%B8%B8%E7%94%A8%E4%B8%89%E6%96%B9%E5%BA%93/" title="swift常用三方库">swift常用三方库</a><time datetime="2022-12-16T06:37:20.115Z" title="更新于 2022-12-16 14:37:20">2022-12-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/12/12/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/GCD%E8%BF%9B%E9%98%B6%E4%B9%8BDispatchWorkItem%E5%92%8CDispatchGroup/" title="GCD进阶之DispatchWorkItem和DispatchGroup"><img src= "" data-lazy-src="/blog/img/defaultCover.png" onerror="this.onerror=null;this.src='/blog/img/defaultCover.gif'" alt="GCD进阶之DispatchWorkItem和DispatchGroup"/></a><div class="content"><a class="title" href="/blog/2022/12/12/iOS%E5%BC%80%E5%8F%91%E8%BF%9B%E9%98%B6/GCD%E8%BF%9B%E9%98%B6%E4%B9%8BDispatchWorkItem%E5%92%8CDispatchGroup/" title="GCD进阶之DispatchWorkItem和DispatchGroup">GCD进阶之DispatchWorkItem和DispatchGroup</a><time datetime="2022-12-12T07:19:37.277Z" title="更新于 2022-12-12 15:19:37">2022-12-12</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fupload-images.jianshu.io%2Fupload_images%2F1345654-f27701c6da64262b.png%3FimageMogr2%2Fauto-orient%2Fstrip%257CimageView2%2F2%2Fw%2F1240&amp;refer=http%3A%2F%2Fupload-images.jianshu.io&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1670155153&amp;t=9df0930adc7e55112de00dc7c84f6f6b')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By Albert Yuan</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcom to my  blog</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="algolia-search"><div class="search-dialog"><div class="search-dialog__title" id="algolia-search-title">Algolia</div><div id="algolia-input-panel"><div id="algolia-search-input"></div></div><hr/><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-stats"></div></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><script src="https://fastly.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="/blog/js/search/algolia.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    chtml: {
      scale: 1.2
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        insertScript: [200, () => {
          document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
            const target = node.parentNode
            if (target.nodeName.toLowerCase() === 'li') {
              target.parentNode.classList.add('has-jax')
            } else {
              target.classList.add('has-jax')
            }
          });
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://fastly.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'REc8eytE1gJDl3d8FkudLNlL-gzGzoHsz',
      appKey: 'gGO3y8I9oVlc4Cd5N1fizNPW',
      avatar: 'monsterid',
      serverURLs: '',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://fastly.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://fastly.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="canvas_nest" defer="defer" color="255,0,0" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://fastly.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script><script src="https://fastly.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = true;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-heart" src="https://fastly.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>